/**
 * 由 WangYu 创建
 * 日期 2017/9/6
 */
import React, {Component} from 'react';
import {
    StyleSheet,
    Text,
    View,
    Image,
    ToastAndroid, TouchableOpacity,
} from 'react-native';
export default class CommonItemView extends Component {

    constructor(props) {
        super(props);
    }

    render() {
        let rightIcon=this.props.rightIcon?this.props.rightIcon:
            <Image source={{uri:'home_arrow'}}
                style={{width:15,height:15}}/>;
        return (
            <TouchableOpacity style={{height:42}}
                              onPress={this.props.onPress}>
            <View style={styles.container}>
                <Text style={styles.textStyle}>{this.props.title}</Text>
                {rightIcon}
            </View>
            </TouchableOpacity>
        );
    }
}

const styles = StyleSheet.create({
    container: {
        flex:1,
        backgroundColor:'white',
        flexDirection:'row',
        paddingRight:10,
        paddingLeft:12,
        alignItems:'center',
        justifyContent:'space-between',
        borderBottomColor:'#e8e8e8',
        borderBottomWidth:1,
    },
    textStyle:{
        fontSize:14,
        color:'black',
    }
});
